-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds filter for failed to replace env in config erros #10237
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approving provided the PR comments are addressed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After extending TypedDependabotError and use it accordingly as mentioned in the comment everything seems great. Nice work.
|
||
sig { params(error_message: String).returns(String) } | ||
def self.extract_var(error_message) | ||
match_data = error_message.match(ENV_VAR_NOT_RESOLVABLE) |
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data High
regular expression
library input
6ad4364
to
47f6791
Compare
What are you trying to accomplish?
Ecosystem : NPM and YARN
Exception Count : 18.3k (Since April 2024)
Preface: Resolving issues related with Dependabot::SharedHelpers::HelperSubprocessFailed issues
Issue: Dependabot will throw uknown_error in case a configuration file is missing an env token. Example
"//registry.npmjs.org/:_authToken" ${NPM_TOKEN}
. Usually env vars are provided through .env file with the project repo or through a CI/CD pipeline. Following is variation of errors that is returned from native helper:Failed to replace env in config: ${GITHUB_TOKEN}
Failed to replace env in config: ${ARTIFACTORY_READ_USER}
Failed to replace env in config: ${FAST_HTTPAUTH}
Failed to replace env in config: ${NPM_TOKEN}
Current error log:
+-------------------------------+
| Dependencies failed to update |
+---------------+---------------+
| js | unknown_error |
+---------------+---------------+
Fix: To capture the response returned from native helper and raise new exception
failed_to_replace_env
exception instead.+---------------------------------------------------+
| Dependencies failed to update |
+-----------+---------------------------------------+
| io | failed_to_replace_env |
+-----------+---------------------------------------+
Anything you want to highlight for special attention from reviewers?
How will you know you've accomplished your goal?
Checklist